When you need to cast expression value to the required type the SmartType code completion will help you. For example, type
  String s = (
and press Ctrl-Shift-Space to see what will happen.